home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / examples / f77 / x13f.f < prev    next >
Encoding:
Text File  |  1994-05-27  |  2.0 KB  |  71 lines

  1. ! $Id: x13f.f,v 1.2 1994/05/26 19:34:27 mjl Exp $
  2. ! $Log: x13f.f,v $
  3. ! Revision 1.2  1994/05/26  19:34:27  mjl
  4. ! Inserted missing CVS Id and Log fields for all Fortran demos.  Comment
  5. ! character changed to "!" everywhere, to work well with font-lock in Lucid
  6. ! emacs (requires a small change to fortran-mode.el).
  7. !
  8. !
  9. !     Demonstration program for PLPLOT: 
  10.  
  11.       parameter (PI=3.14156)
  12.       real just, x(500), y(500), per(5)
  13.       character*20 text(5)
  14.       data text / "Maurice", "Randy", "Mark", "Steve", "Warner"/
  15.  
  16.       per(1) = 10.
  17.       per(2) = 32.
  18.       per(3) = 12.
  19.       per(4) = 30.
  20.       per(5) = 16.
  21.  
  22. ! Ask user to specify the output device.
  23. ! Note that for this demo, neither the global aspect ratio flag nore
  24. ! the global orientation flag give the desired results, since plenv is told
  25. ! to do scaling based on physical dimensions.
  26. ! Thus we MUST print to a physical device and not globally mess with
  27. ! orientation or aspect ratio (this may be improved in the future). 
  28.  
  29.       call plinit()
  30.  
  31.       call plenv(0.,10.,0.,10.,1,-2)
  32.       call plcol(2)
  33.  
  34.       theta0 = 0.
  35.       dthet = 2*PI/500
  36.  
  37.       do 1 i=1,5
  38.          x(1) = 5.
  39.          y(1) = 5.
  40.          j = 1
  41.          theta1 = theta0 + 2*PI*per(i)/100.
  42.          if(i.eq.5) theta1 = 2*PI
  43.          do 2 theta=theta0,theta1,dthet
  44.             j = j + 1
  45.             x(j) = 5 + 3*cos(theta)
  46.             y(j) = 5 + 3*sin(theta)
  47. 2        continue
  48.          call plcol(i)
  49.          call plpsty(mod(i+3,8)+1)
  50.          call plfill(j,x,y)
  51.          call plcol(1)
  52.          call plline(j,x,y)
  53.          just = (theta0+theta1)/2.
  54.          dx = .25*cos(just)
  55.          dy = .25*sin(just)
  56.          if(just .lt. PI/2 .or. just .gt. 3*PI/2) then
  57.             just = 0.
  58.          else 
  59.             just = 1.
  60.          endif
  61.          call plptex(x(j/2)+dx,y(j/2)+dy,1.,0.,just,text(i))
  62.          theta0 = theta-dthet
  63. 1     continue
  64.       call plfont(2)
  65.       call plschr(0.,1.3)
  66.       call plptex(5.,9.,1.,0.,.5,"Percentage of Sales")
  67.  
  68.       call plend
  69.  
  70.       end
  71.